import request from '@/utils/request'

// 登录
export function login(data) {
  return request({
    url: '/api/admin/user/login',
    method: 'post',
    data
  })
}
// 获取验证码
export const getCaptcha = '/api/admin/user/getCaptcha'
// 退出登录
export function logout() {
  return request({
    url: '/api/admin/user/logout',
    method: 'GET'
  })
}
// 新增文章
export function addArticle(data) {
  return request({
    url: '/api/admin/article/addArticle',
    method: 'post',
    data
  })
}
// 删除文章
export function delArticle(data) {
  return request({
    url: '/api/admin/article/delArticle',
    method: 'get',
    params: data
  })
}
// 编辑文章
export function editArticle(data) {
  return request({
    url: '/api/admin/article/editArticle',
    method: 'post',
    data
  })
}
// 根据id查询文章
export function getArticleById(data) {
  return request({
    url: '/api/admin/article/getArticleById',
    method: 'get',
    params: data
  })
}
// 启用-停用文章
export function enableArticle(data) {
  return request({
    url: '/api/admin/article/enableArticle',
    method: 'get',
    params: data
  })
}
// 文章列表
export function queryArticleList(data) {
  return request({
    url: '/api/admin/article/queryArticleList',
    method: 'post',
    data
  })
}
